home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJLSR106.ARJ / GNUFUNCS.S < prev    next >
Text File  |  1992-03-02  |  833b  |  57 lines

  1. /* History:105,12 */
  2. /* gnu's CC1 library of math functions */
  3.  
  4. /*
  5. **    12(%ebp) == b
  6. **    8(%ebp) == a
  7. */
  8.  
  9.     .text
  10.  
  11.     .globl    ___udivsi3
  12. ___udivsi3:
  13.     pushl    %ebp
  14.     movl    %esp,%ebp
  15.     movl    8(%ebp),%eax
  16.     movl    $0,%edx
  17.     divl    12(%ebp)
  18.     popl    %ebp
  19.     ret
  20.  
  21.     .globl    ___divsi3
  22. ___divsi3:
  23.     pushl    %ebp
  24.     movl    %esp,%ebp
  25.     movl    8(%ebp),%eax
  26.     cdq
  27.     idivl    12(%ebp)
  28.     popl    %ebp
  29.     ret
  30.  
  31.     .globl    ___fixdfsi
  32. ___fixdfsi:
  33.     .globl    ___fixunsdfsi
  34. ___fixunsdfsi:
  35.     pushl    %ebp
  36.     movl    %esp,%ebp
  37.     sub    $12,%esp    /* -12 = old CW, -10 = new CW, -8 = result */
  38.     fstcw    -12(%ebp)
  39.     fwait
  40.     movw    -12(%ebp),%ax
  41.     orw    $0x0c00,%ax
  42.     movw    %ax,-10(%ebp)
  43.     fldcww    -10(%ebp)
  44.     mov    8(%ebp),%eax    /* for debugging only */
  45.     fwait
  46.     fldl    8(%ebp)
  47.     fwait
  48.     fistpq    -8(%ebp)
  49.     fwait
  50.     fldcww    -12(%ebp)
  51.     fwait
  52.     mov    -8(%ebp),%eax
  53.     movl    %ebp,%esp
  54.     popl    %ebp
  55.     ret
  56.  
  57.